import formBuilder from "@/comps/form/formBuilder";
import apiOrder from "../../Orders/js/api";
import apiProduct from "../../Product/js/api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addSearch("orderId","订单",6)
            .setApi(apiOrder.urlChoice)

        fb.addSearch("productId","产品",6)
            .setApi(apiProduct.urlChoice)

        fb.addText("num","数量",3).setTypeNumber()
            .setRules([fb.R.notNull("数量不能为空")])

        fb.addText("price").setSpan(3).setLabel("单价").setTypeNumber()

        fb.addText("cost").setSpan(3).setLabel("费用").setTypeNumber()
            .setRules([fb.R.notNull("费用不能为空")])


        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}